﻿<Application x:Class="PrismEx.SampleApp.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
             xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:PrismEx.SampleApp"
             Startup="ApplicationStartup">
    <Application.Resources>
        <ResourceDictionary>
            <!--<ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="BP.xaml" />
            </ResourceDictionary.MergedDictionaries>-->
            
            <!--<SolidColorBrush x:Key="AccentBrush" Color="#3399FF" />-->
            <!--<SolidColorBrush x:Key="AccentBrush" Color="#A7D11C" />-->
            <SolidColorBrush x:Key="AccentBrush" Color="#FF3511" />

            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="FontFamily" Value="Segoe WP Light" />
            </Style>
            <Style x:Key="windowStyle" TargetType="{x:Type Window}">
                <Style.Resources>
                    <sys:Double x:Key="CaptionHeight">25</sys:Double>
                    <Thickness x:Key="BorderThickness">6</Thickness>
                    <Color x:Key="WindowBorderColor">#FFEFEFEF</Color>
                    <SolidColorBrush x:Key="WindowBorderBrush" Color="{StaticResource WindowBorderColor}" />
                </Style.Resources>
                <Setter Property="shell:WindowChrome.WindowChrome">
                    <Setter.Value>
                        <shell:WindowChrome
                            ResizeBorderThickness="{StaticResource BorderThickness}"
                            CaptionHeight="{StaticResource CaptionHeight}"
                            CornerRadius="0,0,0,0"
                            GlassFrameThickness="0"/>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Window}">
                            <Border BorderBrush="{StaticResource WindowBorderBrush}" BorderThickness="{StaticResource BorderThickness}" Background="White">
                                <DockPanel>
                                    <Border Height="{StaticResource CaptionHeight}" DockPanel.Dock="Top" Background="{StaticResource WindowBorderBrush}">
                                        <Grid>
                                            <TextBlock Text="{TemplateBinding Title, Converter={local:ToLowerCaseConverter}}" FontSize="14" />
                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                <StackPanel.Resources>
                                                    <Style TargetType="{x:Type Button}">
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type Button}">
                                                                    <ContentPresenter />
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </StackPanel.Resources>
                                                <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" 
                                            Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(shell:WindowChrome.WindowChrome).ResizeBorderThickness}">
                                                    <TextBlock Text="0" FontFamily="Marlett" />
                                                </Button>
                                                <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" 
                                            Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(shell:WindowChrome.WindowChrome).ResizeBorderThickness}">
                                                    <TextBlock Text="1" FontFamily="Marlett" />
                                                </Button>
                                                <Button shell:WindowChrome.IsHitTestVisibleInChrome="True" 
                                            Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(shell:WindowChrome.WindowChrome).ResizeBorderThickness}">
                                                    <TextBlock Text="r" FontFamily="Marlett" />
                                                </Button>
                                            </StackPanel>
                                        </Grid>
                                    </Border>
                                    <ContentPresenter />
                                </DockPanel>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <ControlTemplate x:Key="PhoneProgressBarSliderThumb" TargetType="Thumb">
                <Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4"/>
            </ControlTemplate>
            <Style x:Key="PhoneProgressBarSliderStyle" TargetType="Slider">
                <Setter Property="Maximum" Value="3000"/>
                <Setter Property="Minimum" Value="0"/>
                <Setter Property="Value" Value="0"/>
                <Setter Property="Opacity" Value="0"/>
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Slider">
                            <Track x:Name="PART_Track" Grid.Row="1">
                                <Track.Thumb>
                                    <Thumb x:Name="Thumb" Height="4" IsTabStop="False" Template="{StaticResource PhoneProgressBarSliderThumb}" Foreground="{TemplateBinding Foreground}"/>
                                </Track.Thumb>
                            </Track>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ProgressBarStyle1" TargetType="ProgressBar">
                <Setter Property="Foreground" Value="{StaticResource AccentBrush}"/>
                <Setter Property="Background" Value="{StaticResource AccentBrush}"/>
                <Setter Property="Maximum" Value="100"/>
                <Setter Property="IsHitTestVisible" Value="False"/>
                <Setter Property="Padding" Value="10"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ProgressBar">
                            <Grid>
                                <Grid x:Name="DeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Visible">
                                    <Rectangle x:Name="PART_Track" Fill="{TemplateBinding Background}" Height="4" Opacity="0.1"/>
                                    <Rectangle x:Name="PART_Indicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="4"/>
                                </Grid>
                                <Border x:Name="IndeterminateRoot"  Visibility="Visible">
                                    <Grid>
                                        <Slider x:Name="Slider1" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}" />
                                        <Slider x:Name="Slider2" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                        <Slider x:Name="Slider3" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                        <Slider x:Name="Slider4" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                        <Slider x:Name="Slider5" Foreground="{TemplateBinding Foreground}" Style="{StaticResource PhoneProgressBarSliderStyle}"/>
                                    </Grid>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsIndeterminate" Value="True">
                                    <Trigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard Duration="00:00:04.4" RepeatBehavior="Forever">
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateRoot">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeterminateRoot">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Collapsed</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider1">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                    <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                    <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider2">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                    <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                    <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider3">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                    <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                    <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider4">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                    <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                    <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Value" Storyboard.TargetName="Slider5">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="1000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseOut" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                    <LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="2000"/>
                                                    <EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="3000">
                                                        <EasingDoubleKeyFrame.EasingFunction>
                                                            <ExponentialEase EasingMode="EaseIn" Exponent="1"/>
                                                        </EasingDoubleKeyFrame.EasingFunction>
                                                    </EasingDoubleKeyFrame>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider1">
                                                    <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider2">
                                                    <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider3">
                                                    <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider4">
                                                    <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Slider5">
                                                    <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    <DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </Trigger.EnterActions>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</Application>
